package com.dxq.test.db;

import com.j256.ormlite.field.DatabaseField;
import com.j256.ormlite.table.DatabaseTable;

/**
 * Author: zsh
 * Date: 2023/11/18
 * Describe: 饲喂表与群组表、饲料表的关联表
 */
@DatabaseTable(tableName = "FeedGroupFood")
public class FeedGroupFood {

	public final static String FEED_ID_FIELD_NAME = "feed_id";
	public final static String GROUP_ID_FIELD_NAME = "group_id";
	public final static String FOOD_ID_FIELD_NAME = "food_id";

	@DatabaseField(generatedId = true)
	int id;

	// feed
	@DatabaseField(foreign = true, columnName = FEED_ID_FIELD_NAME)
	Feed feed_id;

	// group
	@DatabaseField(foreign = true, columnName = GROUP_ID_FIELD_NAME)
	Group group_id;

	// food
	@DatabaseField(foreign = true, columnName = FOOD_ID_FIELD_NAME)
	Food food_id;

	FeedGroupFood() {
		// for ormlite
	}

	public FeedGroupFood(Feed feed_id, Group group_id, Food food_id) {
		this.feed_id = feed_id;
		this.group_id = group_id;
		this.food_id = food_id;
	}

	@Override
	public String toString() {
		return "FeedGroupFood{" +
				"id=" + id +
				", feed_id=" + feed_id +
				", group_id=" + group_id +
				", food_id=" + food_id +
				'}';
	}
}
